import { ref } from "vue";
import { getBanners } from "@/api/home";

export default function useBanners() {
  // 轮播图数据
  const banners = ref(null);
  // 获取轮播图数据
  const getData = (num) => {
    getBanners(num).then((data) => {
      banners.value = data.result;
      console.log(banners.value);
    });
  };
  return { banners, getData };
}
